<ion-modal-view>
  <ion-header-bar class="bar bar-royal">
    <h1 class="title">添加用户账户</h1>
    <div class="buttons">
      <button class="button button-icon ion-ios-close-empty" ng-click="modal.hide();"></button>
    </div>
    </ion-header-bar>
    <ion-content>
      <ion-list class="wrap-light2">
        <ion-item class="item-divider margin-top-large">
            账号
        </ion-item>

        <ion-item class="item-base item-select">
          <span class="list-label text-right">所属部门</span>
          <select ng-model="newUser.profile.department">
            <option ng-repeat="department in departments" value="{{department.name}}">{{department.name}}</option>
          </select>
        </ion-item>

        <ion-item class="item-base item-select">
          <span class="list-label text-right">职能</span>
          <select ng-model="newUser.profile.roleName">
            <option ng-repeat="role in roles.value_set" value="{{role.name}}">{{role.name}}</option>
          </select>
        </ion-item>


        <ion-item class="item-input">
          <span class="list-label text-right">用户名</span>
          <input type="text" placeholder="用户名" ng-model="newUser.username">
        </ion-item>
        <ion-item class="item-input">
          <span class="list-label text-right">工作邮箱</span>
          <input type="email" placeholder="工作邮箱" ng-model="newUser.emails[0].address">
        </ion-item>
        <ion-item class="text-center">
          初始密码： 888888，分配后请员工自行修改
        </ion-item>

        <ion-item class="item-divider margin-top-large">
            指定员工
        </ion-item>
        <ion-item class="item-select">
          <span class="input-label">选择员工</span>
          <select ng-model="newUser.profile.employee_id">
            <option value="">请选择</option>
            <option ng-repeat="employee in employees" value="{{employee._id}}">{{employee.name}}</option>
          </select>
        </ion-item>

        <button class="button button-block button-royal" ng-click="add()">确认添加</button>

      </ion-list>
    </ion-content>
</ion-modal-view>
